//
//  ITTDataRequest.m
//
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "ITTDataRequest.h"
#import "DemoModel.h"

@implementation GetDemoModelDataRequest

- (NSString *)getRequestUrl{
    return @"http://sites/itotemsample/getdemomodel.php";
}

- (void)processResult{
    [super processResult];
    if ([self isSuccess]) {
        NSMutableArray *models = [NSMutableArray array];
        NSMutableArray *modelDicArray = [self.resultDic objectForKey:@"models"];
        for (NSDictionary *modelDic in modelDicArray) {
            DemoModel *demoModel = [[[DemoModel alloc] initWithDataDic:modelDic] autorelease];
            [models addObject:demoModel];
        }
        [self.resultDic removeAllObjects];
        [self.resultDic setObject:models forKey:@"models"];
    }
}
@end